Skip to content

Set MSBUILDDEBUGPATH in CI so MSBuild crash diagnostics are preserved#126012

Open
danmoseley wants to merge 2 commits intodotnet:mainfrom
danmoseley:msbuild-debugpath-ci
Open

Set MSBUILDDEBUGPATH in CI so MSBuild crash diagnostics are preserved#126012
danmoseley wants to merge 2 commits intodotnet:mainfrom
danmoseley:msbuild-debugpath-ci

Conversation

@danmoseley
Copy link
Member

@danmoseley danmoseley commented Mar 24, 2026

Note

This PR was generated with the help of GitHub Copilot.

Set MSBUILDDEBUGPATH in CI so MSBuild crash diagnostics are preserved in more build types.

When MSBuild worker nodes crash during CI builds (see #92290), diagnostic MSBuild_*.failure.txt files are written to a system temp directory on the ephemeral build agent and lost when the agent is cleaned up. This makes it impossible to determine the root cause of the crashes.

Several component-specific build scripts (src/coreclr/build-runtime.sh, src/tests/build.sh, src/native/corehost/build.sh) already set MSBUILDDEBUGPATH to artifacts/log/<config>/MsbuildDebugLogs, but the top-level build invoked by the pipeline template (global-build-step.yml) does not. Build legs that don't go through one of those component scripts — such as the macOS libs/mono builds currently hitting #92290 — get the default temp dir.

This adds MSBUILDDEBUGPATH as a job-level pipeline variable in global-build-job.yml, pointing to the same artifacts/log/<config>/MsbuildDebugLogs path. The existing condition: always() log publishing step in job.yml already sweeps artifacts/log/, so the failure diagnostics will be automatically published as build artifacts the next time a crash occurs.

When MSBuild worker nodes crash during builds (dotnet#92290),
diagnostic failure.txt files are written to a system temp directory on
the ephemeral agent and lost. This sets MSBUILDDEBUGPATH to a path
under artifacts/log/ so the existing always-on log publishing step
picks them up automatically.

The coreclr build scripts already set this for their specific build
steps, but this covers all build legs including the macOS libs/mono
builds that are currently hitting the issue.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the CI global build job template to set MSBUILDDEBUGPATH so MSBuild crash diagnostics (e.g., MSBuild_*.failure.txt) are written under artifacts/log/... and can be published with build logs instead of being lost in ephemeral agent temp directories.

Changes:

  • Add a job-level MSBUILDDEBUGPATH pipeline variable in the global build job template.
  • Point MSBUILDDEBUGPATH at artifacts/log/<config>/MsbuildDebugLogs to align with existing log publishing.

@danmoseley
Copy link
Member Author

@copilot handle feedback

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants